@layout("/common/_container.html",{plugins:["ztree"],js:["/assets/business/category/category.js"]}){

<div class="layui-body-header">
    <span class="layui-body-header-title">分类管理</span>
</div>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-sm12 layui-col-md3 layui-col-lg2">
            <div class="layui-card">
                <div class="layui-card-body mini-bar">
                    <div class="ztree" id="categoryTree"></div>
                </div>
            </div>
        </div>
        <div class="layui-col-sm12 layui-col-md9 layui-col-lg10">
            <div class="layui-card">
                <div class="layui-card-body">
                    <div class="layui-form toolbar">
                        <div class="layui-form-item">
                            <div class="layui-inline">
                                <input id="name" class="layui-input" type="text" placeholder="名称"/>
                            </div>
                            <div class="layui-inline">
                                <button id="btnSearch" class="layui-btn icon-btn"><i class="layui-icon">&#xe615;</i>搜索</button>
                                <button id="btnAdd" class="layui-btn icon-btn"><i class="layui-icon">&#xe654;</i>添加</button>
                                <button id="btnInitCache" class="layui-btn icon-btn"><i class="layui-icon">&#xe653;</i>初始化分类缓存</button>
                            </div>
                        </div>
                    </div>
                    <table class="layui-table" id="categoryTable" lay-filter="categoryTable"></table>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/html" id="tableBar">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">修改</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="delete">删除</a>
    {{#  if(d.level >= 2){ }}
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="setContent">设置获取方式</a>
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="setChannel">设置销卡渠道</a>
    {{#  } }}
</script>

<script type="text/html" id="hotTpl">
    <input type="checkbox" lay-filter="hot" value="{{d.categoryId}}" lay-skin="switch" lay-text="是|否" {{d.hot==1?'checked':''}} />
</script>

<script type="text/html" id="sellTpl">
    <input type="checkbox" lay-filter="sell" value="{{d.categoryId}}" lay-skin="switch" lay-text="是|否" {{d.sellStatus==1?'checked':''}} />
</script>
@}
